package com.woniuxy.microuserserver.service.impl;

import com.woniuxy.microcommonserver.bean.user_hpd.UserHobby;
import com.woniuxy.microcommonserver.bean.user_hpd.UserInfo;
import com.woniuxy.microuserserver.mapper.UserHobbyMapper;
import com.woniuxy.microuserserver.service.IUserHobbyService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

@Service
@Transactional(readOnly = true)
public class UserHobbyServiceImpl implements IUserHobbyService {
    @Resource
    private UserHobbyMapper userHobbyMapper;

    @Transactional(propagation = Propagation.REQUIRED,rollbackFor = Exception.class)
    @Override
    public void addHobby(Long uId) {
        userHobbyMapper.addHobby(uId);
    }

    @Transactional(propagation = Propagation.REQUIRED,rollbackFor = Exception.class)
    @Override
    public void updateHobby(UserHobby userHobby) {
        userHobbyMapper.updateHobby(userHobby);
    }
}
